/**
 * <copyright>
 * </copyright>
 *

 */
package br.pucrio.inf.tamdera.impl;

import br.pucrio.inf.tamdera.NameClassMapping;
import br.pucrio.inf.tamdera.TamderaPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Name Class Mapping</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link br.pucrio.inf.tamdera.impl.NameClassMappingImpl#getNameOfClass <em>Name Of Class</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class NameClassMappingImpl extends ConceptMapImpl implements NameClassMapping
{
  /**
   * The default value of the '{@link #getNameOfClass() <em>Name Of Class</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getNameOfClass()
   * @generated
   * @ordered
   */
  protected static final String NAME_OF_CLASS_EDEFAULT = null;

  /**
   * The cached value of the '{@link #getNameOfClass() <em>Name Of Class</em>}' attribute.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getNameOfClass()
   * @generated
   * @ordered
   */
  protected String nameOfClass = NAME_OF_CLASS_EDEFAULT;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected NameClassMappingImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return TamderaPackage.Literals.NAME_CLASS_MAPPING;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getNameOfClass()
  {
    return nameOfClass;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setNameOfClass(String newNameOfClass)
  {
    String oldNameOfClass = nameOfClass;
    nameOfClass = newNameOfClass;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, TamderaPackage.NAME_CLASS_MAPPING__NAME_OF_CLASS, oldNameOfClass, nameOfClass));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case TamderaPackage.NAME_CLASS_MAPPING__NAME_OF_CLASS:
        return getNameOfClass();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case TamderaPackage.NAME_CLASS_MAPPING__NAME_OF_CLASS:
        setNameOfClass((String)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case TamderaPackage.NAME_CLASS_MAPPING__NAME_OF_CLASS:
        setNameOfClass(NAME_OF_CLASS_EDEFAULT);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case TamderaPackage.NAME_CLASS_MAPPING__NAME_OF_CLASS:
        return NAME_OF_CLASS_EDEFAULT == null ? nameOfClass != null : !NAME_OF_CLASS_EDEFAULT.equals(nameOfClass);
    }
    return super.eIsSet(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public String toString()
  {
    if (eIsProxy()) return super.toString();

    StringBuffer result = new StringBuffer(super.toString());
    result.append(" (nameOfClass: ");
    result.append(nameOfClass);
    result.append(')');
    return result.toString();
  }

} //NameClassMappingImpl
